use rand::Rng;
use std::cmp::Ordering;
use std::io;
use std::{thread, time};


// Debug输出格式, Debug是一个trait, derive增加派生Debug trait
#[derive(Debug)]
enum IpAddrKind {
    V4,
    V6,
}

#[derive(Debug)]
struct IpAddr {
    kind: IpAddrKind,
    address: String,
}


pub fn simpleFn() {
    println!("#################################");
    println!("##      simpleFn                 ");
    println!("#################################");
    println!("simpleFn.");

    let four = IpAddrKind::V4;
    let six = IpAddrKind::V6;
    // dbg! 宏 使的对象以 error 输出
    println!("simpleFn four:{:?},six:{:?}.", four, six);

    let home = IpAddr {
        kind: IpAddrKind::V4,
        address: String::from("127.0.0.1"),
    };
    let loopback = IpAddr {
        kind: IpAddrKind::V6,
        address: String::from("::1"),
    };
    /*   格式化打印   */
    println!("simpleFn IpAddr home is: {:#?}", home);
    println!("simpleFn IpAddr loopback is: {:#?}", loopback);

    route(IpAddrKind::V4);
    route(IpAddrKind::V6);
}

fn route(ip_kind: IpAddrKind) {}